﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddUser.aspx.cs" Inherits="LotteryVote.AddUser"
    Culture="auto" meta:resourcekey="PageResource1" UICulture="auto" %>

<%@ Register Src="~/Controls/UserStateDropDownList.ascx" TagPrefix="LV" TagName="UserState" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="JS/jquery-1.5.1.min.js" type="text/javascript"></script>
    <script src="JS/jquery-ui-1.8.18.custom.min.js" type="text/javascript"></script>
    <link href="UI/start/jquery-ui-1.8.18.custom.css" rel="stylesheet" type="text/css" />
    <link href="Style/comm.css" rel="stylesheet" type="text/css" />
    <link href="Style/EditUser.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <table cellpadding="0" cellspacing="0">
        <thead>
            <tr>
                <td colspan="2">
                    <%=GetGlobalResourceObject("Resource","New")+ GetAgentType() %>
                </td>
            </tr>
        </thead>
        <colgroup>
            <col style="width: 25%" />
            <col style="width: 75%" />
        </colgroup>
        <tbody>
            <tr>
                <td>
                    <%=GetGlobalResourceObject("Resource","YourPassword") %>
                </td>
                <td>
                    <asp:TextBox ID="txt_myPassword" runat="server" TextMode="Password"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    <%=GetGlobalResourceObject("Resource","UserName") %>
                </td>
                <td>
                    <asp:TextBox ID="txt_userName" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    <%=GetGlobalResourceObject("Resource","Name") %>
                </td>
                <td>
                    <asp:TextBox ID="txt_name" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    <%=GetGlobalResourceObject("Resource","Password") %>
                </td>
                <td>
                    <asp:TextBox ID="txt_password" runat="server" TextMode="Password"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    <%=GetGlobalResourceObject("Resource", "Confirm")%>
                </td>
                <td>
                    <asp:TextBox ID="txt_comfirmPwd" runat="server" TextMode="Password"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    <%=GetGlobalResourceObject("Resource", "Status")%>
                </td>
                <td>
                    <LV:UserState ID="lv_userState" runat="server" />
                </td>
            </tr>
            <tr>
                <td>
                    <%=GetGlobalResourceObject("Resource", "Currency")%>
                </td>
                <td>
                    VND
                </td>
            </tr>
            <tr>
                <td>
                    <%=GetGlobalResourceObject("Resource", "GivenCredit")%>
                </td>
                <td>
                    <asp:TextBox ID="txt_givenCredit" runat="server"></asp:TextBox>
                    <%=GetGlobalResourceObject("Resource", "AvailableGivenCredit")%>
                    <%=CurrentUser.UserInfo.AvailableGivenCredit %>
                </td>
            </tr>
            <tr>
                <td>
                    <%=GetGlobalResourceObject("Resource", "Email")%>
                </td>
                <td>
                    <asp:TextBox ID="txt_Email" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    <%=GetGlobalResourceObject("Resource", "Market")%>
                </td>
                <td>
                    <asp:CheckBox ID="ck_lotterySpecie" runat="server" Checked="true" Enabled="false"
                        Text="<%$Resources:Resource,VietnamLottery %>" />
                </td>
            </tr>
            <%if (CurrentUser.Role < LotteryVote.Entity.SystemRole.Agent)
              { %>
            <tr>
                <td>
                    <%=GetGlobalResourceObject("Resource", "ShareRateLimit")%>
                </td>
                <td>
                    <%=GetGlobalResourceObject("Resource", "Min")%>0%
                    <%=GetGlobalResourceObject("Resource", "Max")%><%=CurrentUser.UserInfo.ShareRate * 100%>%
                </td>
            </tr>
            <tr>
                <td>
                    <%=GetGlobalResourceObject("Resource", "ShareRate")%>
                </td>
                <td>
                    <asp:TextBox ID="txt_shareRate" runat="server"></asp:TextBox>
                </td>
            </tr>
            <%} if (CurrentUser.Role == LotteryVote.Entity.SystemRole.Agent)
              { %>
            <tr>
                <td>
                    <%=GetGlobalResourceObject("Resource", "Package")%>
                </td>
                <td>
                    <asp:DropDownList ID="ddl_package" runat="server">
                    </asp:DropDownList>
                </td>
            </tr>
            <%} %>
            <tr>
                <td colspan="2">
                    <asp:Button ID="btn_submit" runat="server" Text="<%$Resources:Resource,Submit %>"
                        OnClick="btn_submit_Click" />
                    <input type="button" id="cancel" value='<%=GetGlobalResourceObject("Resource","Cancel") %>' />
                </td>
            </tr>
        </tbody>
    </table>
    <script type="text/javascript">
        $("document").ready(function () {
            $(".ui-corner-all").bind("click", function () {
                parent.reloadPage();
            });
            $("#cancel").bind("click", function () {
                parent.reloadPage();
            })
        });
        var showMessage = function (title, content) {
            var htmlArr = new Array();
            htmlArr.push("<div title=\"" + title + "\">");
            htmlArr.push("<p>" + content + "</p>");
            htmlArr.push("</div>");
            var msgBox = $(htmlArr.join(""));
            msgBox.appendTo($(document));
            msgBox.dialog({ modal: true, buttons: { "OK": function () {
                parent.reloadPage();
            }
            }
            });
        }
    </script>
    </form>
</body>
</html>
